﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Phoenix.Cache
{
    /// <summary>
    /// Memcached服务器
    /// </summary>
    public class MemcachedServer
    {
        #region Properties

        /// <summary>
        /// 主机名称
        /// </summary>
        public string Host
        {
            get;
            private set;
        }

        /// <summary>
        /// 端口号
        /// </summary>
        public int Port
        {
            get;
            private set;
        }

        /// <summary>
        /// 权重
        /// </summary>
        public int Weight
        {
            get;
            private set;
        }

        #endregion

        #region Constructors

        /// <param name="host">主机名称</param>
        /// <param name="port">端口号</param>
        /// <param name="weight">权重</param>
        public MemcachedServer(string host, int port, int weight)
        {
            if (string.IsNullOrEmpty(host))
            {
                throw new ArgumentException("host", "主机名称不能为空");
            }

            this.Host = host;
            this.Port = port;
            this.Weight = weight;
        }

        #endregion
    }
}
